package com.example.seleniumautotest.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Objects;
import java.util.concurrent.TimeUnit;

@Component
@Slf4j
public class DelayUtils {
    // 延迟器
    public void delay(int duration) {
        if (Objects.nonNull(duration) && duration > 0){
            log.info("等待 {} ...",duration);
            try {
                TimeUnit.SECONDS.sleep(duration);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
